import Vue from 'vue';
import Vuex from 'vuex';
import utils from '@/utils'

Vue.use(Vuex);

const store = new Vuex.Store({
    modules: {},
    state: {
        form: {
            systemId: '',
            areaId: '',
            siteId: '',
            deptId: '',
            personId: '',
            timelimit: '',
            photopath: '',
            reactcontent: '',
            deptpersonId: '',
            safeCheckcontent: '',
            project: '',
            time1: ''
        },
        safeList: []
    },
    mutations: {
        addList() {
            this.state.safeList.push(JSON.parse(JSON.stringify(this.state.form)))
        },
        delItem(state, num) {
            console.log(num)
            state.safeList.splice(num, 1)
        }
    },
    actions: {
        delItem({
            commit
        }, num) {
            commit('delItem', num)
        },
    }
});

export default store;